gtkpadcontroller: Avoid filling action list with empty elements
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 24 Apr 2020 20:21:08 +0000 (22:21 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Fri, 24 Apr 2020 20:21:08 +0000 (22:21 +0200)
We don't need to set the array size if we are adding elements afterwards.

gtk/gtkpadcontroller.c

index 833bf423383abc41e538defb72029dbc1d2345d9..357670adc952cbd8dbf76b5593dbaaf548e78bd6 100644 (file)
@@ -452,8 +452,6 @@ gtk_pad_controller_add_entry (GtkPadController        *controller,
    .action_name = g_strdup (entry->action_name)
   };
 
-  g_array_set_size (controller->action_entries, controller->action_entries->len + 1);
-
   for (i = 0; i < controller->action_entries->len; i++)
     {
       if (entry_compare_func (&new_entry,